<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta charset="UTF-8">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/layx.min.css" media="all">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <title>cliblan 房间</title>
</head>

<body>

    <div class="layui-container" id="app" style="background-color: white">
        <div class="layui-row">
            <div class="layui-col-xs12">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
                    <legend>房间列表</legend>
                </fieldset>

                <table class="layui-hide" id="list"></table>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="js/jquery.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/layx.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="js/vue.min.js" charset="utf-8"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            layui.use('table', function () {
                var table = layui.table;

                table.render({
                    elem: '#list',
                    url: '/api2/room',
                    cellMinWidth: 80,
                    cols: [
                        [{
                            field: 'id',
                            width: 80,
                            title: '编号',
                            sort: true
                        }, {
                            field: 'player1',
                            width: 80,
                            title: '玩家一'
                        }, {
                            field: 'player2',
                            width: 80,
                            title: '玩家二'
                        }, {
                            width: 200,
                            field: 'createtime',
                            title: '创建时间',
                            sort: true
                        }]
                    ],
                    page: true
                });
            });
        });
    </script>
</body>

</html>